#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2023/9/13 11:26
# @Author  : 王凯
# @File    : hebei_illegal.py
# @Project : spider-man

from apps.tax_illegal.tax_illegal.spiders import BaseTaxIllegalSpider


class HebeiIllegalSpider(BaseTaxIllegalSpider):
    name: str = "hebei_illegal"
    province: str = "河北"
    url: str = (
        "http://wzyy.hebei.chinatax.gov.cn/LawPublicity/app-publicity-service/law/penalty/findTaxDishonestyCasesList"  # 取首页
    )
    custom_settings = {
        "HTTPERROR_ALLOWED_CODES": [400, 403],
        "RETRY_HTTP_CODES": [403],
    }

    def start_requests(self):
        yield from self.etax_search(**{"etax_url": "https://etax.hebei.chinatax.gov.cn:8443"})


if __name__ == "__main__":

    from scrapy import cmdline

    cmdline.execute(argv=["scrapy", "crawl", "hebei_illegal"])
